//
//  ZBSegmentedViewController.m
//  XZBProduct
//
//  Created by xzb on 2019/1/3.
//  Copyright © 2019 xzb. All rights reserved.
//

#import "ZBSegmentedViewController.h"
#import "ZBSegmentedView.h"
#import "ZBSegmentedDelegate.h"

@interface ZBSegmentedViewController () <ZBSegmentedDelegate>

@property (nonatomic, strong) ZBSegmentedView *segmentedView;

@end

@implementation ZBSegmentedViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.segmentedView.delegate = self;
    [self.view addSubview:self.segmentedView];
    
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.segmentedView setTitleObjects:@[@"今日特卖", @"新品", @"居家", @"服饰", @"水果"]];
    
}
- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    
    self.segmentedView.frame = CGRectMake(0, self.navigationBarBottom, self.view.width, 40);
    
}

ZBLazyProperty(ZBSegmentedView, segmentedView);

- (void)segmentedViewDidSelcted:(NSUInteger)index object:(id)object {
    
    NSLog(@"--->%ld,--obj -->%@",index, object);
}

@end
